package chapter3.section7;

/**
 * 程序 3-16：用递归法求解阶乘
 *
 * @author 张玮婷 20245080902061
 */

public class Recursion {
    static int fac(int n) {
        if (n == 1) return 1;
        else return n * fac(n - 1);
    }

    public static void main(String[] args) {
        int f = fac(5);
        System.out.println("5!=" + f);
    }
}
